From 2e4dd40ee9770d5d310466f7023762b114da6821 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 4 Sep 2020 09:32:01 +0200 Subject: [PATCH] Bump cmake version to 3.16 Streamline the features list handling in the module CMakeLists to use the list functionality introduced in cmake 3.3. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I184034cae408c815bd80a09016a21fde2969449e Reviewed-by: Christian Tismer Gbp-Pq: Name Bump-cmake-version-to-3.16.patch --- CMakeLists.txt | 4 ++-- examples/samplebinding/CMakeLists.txt | 4 ++-- examples/scriptableapplication/CMakeLists.txt | 4 ++-- examples/widgetbinding/CMakeLists.txt | 4 ++-- sources/pyside2-tools/CMakeLists.txt | 2 +- sources/pyside2/CMakeLists.txt | 4 ++-- sources/pyside2/PySide2/QtGui/CMakeLists.txt | 4 +--- .../pyside2/PySide2/QtNetwork/CMakeLists.txt | 21 +++++-------------- sources/pyside2/doc/CMakeLists.txt | 4 ++-- .../pyside2/tests/pysidetest/CMakeLists.txt | 2 +- sources/shiboken2/ApiExtractor/CMakeLists.txt | 4 ++-- sources/shiboken2/CMakeLists.txt | 4 ++-- sources/shiboken2/doc/CMakeLists.txt | 2 +- sources/shiboken2/tests/CMakeLists.txt | 2 +- .../tests/test_generator/CMakeLists.txt | 2 +- 15 files changed, 27 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 595489d..3c2ba1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build Type") diff --git a/examples/samplebinding/CMakeLists.txt b/examples/samplebinding/CMakeLists.txt index cb61358..f7651e0 100644 --- a/examples/samplebinding/CMakeLists.txt +++ b/examples/samplebinding/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) # Enable policy to not use RPATH settings for install_name on macOS. if(POLICY CMP0068) diff --git a/examples/scriptableapplication/CMakeLists.txt b/examples/scriptableapplication/CMakeLists.txt index 5277d17..7fe3b25 100644 --- a/examples/scriptableapplication/CMakeLists.txt +++ b/examples/scriptableapplication/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) # Enable policy to run automoc on generated files. if(POLICY CMP0071) diff --git a/examples/widgetbinding/CMakeLists.txt b/examples/widgetbinding/CMakeLists.txt index a557f90..2966e63 100644 --- a/examples/widgetbinding/CMakeLists.txt +++ b/examples/widgetbinding/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) # Enable policy to not use RPATH settings for install_name on macOS. if(POLICY CMP0068) diff --git a/sources/pyside2-tools/CMakeLists.txt b/sources/pyside2-tools/CMakeLists.txt index ce65750..1492cdf 100644 --- a/sources/pyside2-tools/CMakeLists.txt +++ b/sources/pyside2-tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) project(pyside2-tools) # Don't display "up-to-date / install" messages when installing, to reduce visual clutter. diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 4336d6c..a944017 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -1,7 +1,7 @@ include(cmake/Macros/icecc.cmake) # this must be the first line! -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) # Don't ignore targets that do not exist, inside add_dependencies calls. cmake_policy(SET CMP0046 NEW) diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt index 38a0c1a..438250c 100644 --- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt @@ -224,9 +224,7 @@ if (Qt${QT_MAJOR_VERSION}Gui_VERSION VERSION_EQUAL 5.14.0 endif() # cf qtbase/src/gui/opengl/opengl.pri -list(FIND QtGui_enabled_features "opengles2" _opengles2Index) -# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtGui_enabled_features) -if(_opengles2Index GREATER -1) +if("opengles2" IN_LIST QtGui_enabled_features) list(APPEND QtGui_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery QOpenGLVersionFunctionsFactory) message(STATUS "Qt${QT_MAJOR_VERSION}Gui: Dropping Desktop OpenGL classes (GLES2)") else() diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt index 9557c4a..7d45288 100644 --- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt @@ -47,17 +47,10 @@ ${QtNetwork_GEN_DIR}/qudpsocket_wrapper.cpp ${QtNetwork_GEN_DIR}/qtnetwork_module_wrapper.cpp ) -get_property(QtNetwork_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Network - PROPERTY QT_ENABLED_PUBLIC_FEATURES) get_property(QtNetwork_disabled_features TARGET Qt${QT_MAJOR_VERSION}::Network PROPERTY QT_DISABLED_PUBLIC_FEATURES) -# ### fixme: For cmake >= 3.3, use if( needle IN_LIST list) -list(FIND QtNetwork_enabled_features "ssl" _sslEnabledIndex) -list(FIND QtNetwork_disabled_features "dtls" _dtlsDisabledIndex) -list(FIND QtNetwork_disabled_features "sctp" _sctpDisabledIndex) - -if(_sslEnabledIndex EQUAL -1) +if("ssl" IN_LIST QtNetwork_disabled_features) list(APPEND QtNetwork_DROPPED_ENTRIES QOcspResponse QSslCipher QSslConfiguration QSslDiffieHellmanParameters QSslError QSslKey QSslPreSharedKeyAuthenticator QSslSocket) @@ -72,16 +65,12 @@ else() ${QtNetwork_GEN_DIR}/qsslerror_wrapper.cpp ${QtNetwork_GEN_DIR}/qsslkey_wrapper.cpp ${QtNetwork_GEN_DIR}/qsslpresharedkeyauthenticator_wrapper.cpp - ${QtNetwork_GEN_DIR}/qsslsocket_wrapper.cpp) - if (Qt${QT_MAJOR_VERSION}Network_VERSION VERSION_EQUAL 5.13.0 - OR Qt${QT_MAJOR_VERSION}Network_VERSION VERSION_GREATER 5.13.0) - list(APPEND QtNetwork_SRC - ${QtNetwork_GEN_DIR}/qocspresponse_wrapper.cpp) - endif() + ${QtNetwork_GEN_DIR}/qsslsocket_wrapper.cpp + ${QtNetwork_GEN_DIR}/qocspresponse_wrapper.cpp) message(STATUS "Qt${QT_MAJOR_VERSION}Network: Adding SSL classes") endif() -if(_dtlsDisabledIndex GREATER -1) +if("dtls" IN_LIST QtNetwork_disabled_features) list(APPEND QtNetwork_DROPPED_ENTRIES QDtls) message(STATUS "Qt${QT_MAJOR_VERSION}Network: Dropping DTLS classes") else() @@ -90,7 +79,7 @@ else() message(STATUS "Qt${QT_MAJOR_VERSION}Network: Adding DTLS classes") endif() -if(_sctpDisabledIndex GREATER -1) +if("sctp" IN_LIST QtNetwork_disabled_features) list(APPEND QtNetwork_DROPPED_ENTRIES QSctpServer QSctpSocket) message(STATUS "Qt${QT_MAJOR_VERSION}Network: Dropping SCTP classes") else() diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt index 950e486..77747a4 100644 --- a/sources/pyside2/doc/CMakeLists.txt +++ b/sources/pyside2/doc/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) project(doc) diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index 0dbd2b7..71d92f1 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -1,7 +1,7 @@ project(pysidetest) project(testbinding) -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) set(QT_USE_QTCORE 1) # no more supported: include(${QT_USE_FILE}) diff --git a/sources/shiboken2/ApiExtractor/CMakeLists.txt b/sources/shiboken2/ApiExtractor/CMakeLists.txt index b081bed..1a8b66c 100644 --- a/sources/shiboken2/ApiExtractor/CMakeLists.txt +++ b/sources/shiboken2/ApiExtractor/CMakeLists.txt @@ -1,7 +1,7 @@ project(apiextractor) -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) set(CMAKE_AUTOMOC ON) diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt index c654602..e9f37cf 100644 --- a/sources/shiboken2/CMakeLists.txt +++ b/sources/shiboken2/CMakeLists.txt @@ -1,7 +1,7 @@ Include(icecc.cmake) -cmake_minimum_required(VERSION 3.1) -cmake_policy(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) +cmake_policy(VERSION 3.16) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build Type") diff --git a/sources/shiboken2/doc/CMakeLists.txt b/sources/shiboken2/doc/CMakeLists.txt index ae4858f..5f59bfb 100644 --- a/sources/shiboken2/doc/CMakeLists.txt +++ b/sources/shiboken2/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) if(FULLDOCSBUILD EQUAL 0) project(shiboken2_doc) diff --git a/sources/shiboken2/tests/CMakeLists.txt b/sources/shiboken2/tests/CMakeLists.txt index 2ba951d..fcd3f43 100644 --- a/sources/shiboken2/tests/CMakeLists.txt +++ b/sources/shiboken2/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) if(BUILD_TESTS) find_package(Qt${QT_MAJOR_VERSION}Test 5.12 REQUIRED) diff --git a/sources/shiboken2/tests/test_generator/CMakeLists.txt b/sources/shiboken2/tests/test_generator/CMakeLists.txt index 07611e3..b48ae37 100644 --- a/sources/shiboken2/tests/test_generator/CMakeLists.txt +++ b/sources/shiboken2/tests/test_generator/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.16) project(test_generator) set(dummy_generator_SRC dummygenerator.cpp) -- 2.30.2